<?php

namespace App\Http\Controllers\Store\User;

use App\Services\Store\User\RanchService;
use Exception;
use Illuminate\Http\JsonResponse;

class RanchController extends BaseUserController
{
    protected RanchService $ranchService;

    /**
     * @throws Exception
     */
    public function __construct()
    {
        parent::__construct();
        $this->ranchService = loadService('Store\User\RanchService');
    }

    /**
     * 牧场列表
     * @return JsonResponse
     * @throws Exception
     */
    public function list(): JsonResponse
    {
        $list = $this->ranchService->list();
        return outputJsonResult($list);
    }
}
